-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optionally enable LLVM profile continuous mode #15166
Conversation
LLVM's profile instrumentation offers a continuous mode in which counters are continuously synced to a file rather than being dumped once in an exit hook. This is useful for coverage runs that include binaries that exit abnormally (e.g. in failure tests), but may require additional compiler flags and can negatively impact runtime performance and memory usage. Enabling continuous mode requires adding the "%c" modifier to the value of the LLVM_PROFILE_FILE environment variable. With this commit, the collect_coverage.sh script adds the modifier if the test environment has the variable LLVM_PROFILE_CONTINUOUS_MODE set. This allows both all and individual tests to use continuous mode by setting the variable, either via --test_env or the env attribute.
@c-mita This is a minimal change required to make LLVM profile's continuous mode usable with Bazel at all (everything else can be configured via existing knobs). Since I need this mode to properly generate complete coverage reports for Jazzer, I am very interested in getting at least this change into Bazel. If you would appreciate a better integration, I could submit a follow-up PR that adds the required compiler flags as toolchain features together with an experimental flag, similar to the existing |
@c-mita Sorry for the high PR load, but I assume this one is also yours to review |
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
@c-mita Friendly ping |
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
Coverage reports can be generated via: bazel run //bazel/coverage Due to bazelbuild/bazel#15166, coverage collection does not yet encompass tests that end with a native sanitizer report. Temporarily updates .bazelversion to an unreleased version of Bazel that includes required coverage fixes.
@c-mita Friendly ping, could you take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine. @oquenchil - would it be worth getting this integrated with a flag?
@bazel-io flag |
@bazel-io fork 5.3.0 |
LLVM's profile instrumentation offers a continuous mode in which counters are continuously synced to a file rather than being dumped once in an exit hook. This is useful for coverage runs that include binaries that exit abnormally (e.g. in failure tests), but may require additional compiler flags and can negatively impact runtime performance and memory usage. Enabling continuous mode requires adding the "%c" modifier to the value of the LLVM_PROFILE_FILE environment variable. With this commit, the collect_coverage.sh script adds the modifier if the test environment has the variable LLVM_PROFILE_CONTINUOUS_MODE set. This allows both all and individual tests to use continuous mode by setting the variable, either via --test_env or the env attribute. Closes #15166. PiperOrigin-RevId: 454558752 Change-Id: Id03d00d0644742e336feab41ea479d7d8527f6c4 Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
LLVM's profile instrumentation offers a continuous mode in which counters are continuously synced to a file rather than being dumped once in an exit hook. This is useful for coverage runs that include binaries that exit abnormally (e.g. in failure tests), but may require additional compiler flags and can negatively impact runtime performance and memory usage. Enabling continuous mode requires adding the "%c" modifier to the value of the LLVM_PROFILE_FILE environment variable. With this commit, the collect_coverage.sh script adds the modifier if the test environment has the variable LLVM_PROFILE_CONTINUOUS_MODE set. This allows both all and individual tests to use continuous mode by setting the variable, either via --test_env or the env attribute. Closes bazelbuild#15166. PiperOrigin-RevId: 454558752 Change-Id: Id03d00d0644742e336feab41ea479d7d8527f6c4 Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
LLVM's profile instrumentation offers a continuous mode in which
counters are continuously synced to a file rather than being dumped
once in an exit hook. This is useful for coverage runs that include
binaries that exit abnormally (e.g. in failure tests), but may require
additional compiler flags and can negatively impact runtime performance
and memory usage.
Enabling continuous mode requires adding the "%c" modifier to the value
of the LLVM_PROFILE_FILE environment variable. With this commit, the
collect_coverage.sh script adds the modifier if the test environment has
the variable LLVM_PROFILE_CONTINUOUS_MODE set. This allows both all and
individual tests to use continuous mode by setting the variable, either
via --test_env or the env attribute.